package com.coderman.infosys.auth.domain.enums;

import lombok.Getter;

/**
* @Description:权限状态
* @Author:shenshuai
* @CreateTime:2022-01-02 15:27:38
* @version v1.0
*/
@Getter
public enum AuthorityStatusEnum {

   /**
    *
    */
    NORMAL(1,"启用"),
    DISABLED(0,"禁用"),

   ;

   /** 权限状态code **/
   private Integer status;
   /** 权限状态描述 **/
   private String desc;


   AuthorityStatusEnum(Integer status, String desc){
       this.status = status;
       this.desc = desc;
   }



   /**
    *
    * @Description
    * @return AuthorityStatusEnum
    */
    public static AuthorityStatusEnum getByCode(Integer status){
        for (AuthorityStatusEnum authorityStatusEnum : AuthorityStatusEnum.values()){
            if (authorityStatusEnum.getStatus().equals(status)){
                return authorityStatusEnum;
            }
        }
       return null;
    }

}